import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'home',
    component: HomeView,
    children:[{
      path:'index',
      name:'/home/index',
      component:()=>import('../views/index.vue'),
      meta:{
        nav:[{mname:'首页'}],
      }
    },
    {
      path:'ActorAdd',
      name:'/home/ActorAdd',
      component:()=>import('../views/actor/ActorAdd.vue'),
      meta:{
        nav:[{mname:'首页',path:'/home/index'},{mname:'演员管理'},{mname:'新增演员'}],
      }
    },
    {
      path:'ActorList',
      name:'/home/ActorList',
      component:()=>import('../views/actor/ActorList'),
      meta:{
        nav:[{mname:'首页',path:'/home/index'},{mname:'演员管理'},{mname:'演员列表'}],
      }
    },
    {
      path:'director-add',
      name:'/home/DirectorAdd',
      component:()=>import('../views/director/DirectorAdd.vue'),
      meta:{
        nav:[{mname:'首页',path:'/home/index'},{mname:'导演管理'},{mname:'新增导演'}],
      }
    },
    {
      path:'director-list',
      name:'/home/DirectorList',
      component:()=>import('../views/director/DirectorList.vue'),
      meta:{
        nav:[{mname:'首页',path:'/home/index'},{mname:'导演管理'},{mname:'导演列表'}],
      }
    },
    {
      path:'movie-list',
      name:'/home/MovieList',
      component:()=>import('../views/movie/MovieList.vue'),
      meta:{
        nav:[{mname:'首页',path:'/home/index'},{mname:'电影管理'},{mname:'电影列表'}],
      }
    },
    {
      path:'movie-add',
      name:'/home/MovieAdd',
      component:()=>import('../views/movie/MovieAdd'),
      meta:{
        nav:[{mname:'首页',path:'/home/index'},{mname:'电影管理'},{mname:'新增电影'}],
      }
    },
    {
      path:'movie-update/:id',
      name:'/home/MovieUpdate',
      component:()=>import('../views/movie/MovieUpdate'),
      meta:{
        nav:[{mname:'首页',path:'/home/index'},{mname:'电影管理'},{mname:'电影列表',path:'/home/movie-list'},{mname:'修改电影信息'}],
      }
    },
    {
      path:'cinema_list',
      name:'/home/cinema_list',
      component:()=>import('../views/cinema/CinemaList'),
      meta:{
        nav:[{mname:'首页',path:'/home/index'},{mname:'电影院管理'},{mname:'电影院列表'}],
      }
    },
    {
      path:'cinema_add',
      name:'/home/cinema_add',
      component:()=>import('../views/cinema/CinemaAdd'),
      meta:{
        nav:[{mname:'首页',path:'/home/index'},{mname:'电影院管理'},{mname:'新增电影院'}],
      }
    }
  ]
  },
  {
    path:'/container',
    name:'container',
    component:()=>import('../views/Container')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
